import Vue from "vue";
import Vuex from "vuex";
import moment from "moment"
Vue.use(Vuex);

import state from "./state";
import mutations from "./mutations";
import actions from "./actions";
import getters from "./getters";


var copyState = deepClone(state) // 拷贝state对象
function deepClone (obj) {
var newObj = obj instanceof Array ? [] : {}
for (var i in obj) {
newObj[i] = typeof obj[i] === 'object' ? deepClone(obj[i]) : obj[i]
}
return newObj
}

var store = new Vuex.Store({
  state,
  mutations,
  actions,
  getters
});

export default store;
